package com.zerowidth.moc.web.controller.serviceimpl;

import com.zerowidth.moc.web.controller.service.SocialService;
import com.zerowidth.moc.web.resp.ResCode;
import com.zerowidth.moc.web.resp.ResultBean;
import com.zerowidth.moc.web.resp.helper.ResponseCreator;
import com.zerowidth.db.bean.CommentBean;
import com.zerowidth.db.op.CommentDB;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;

@Service
public class SocialServiceImpl implements SocialService {

    @Override
    public ResponseEntity<ResultBean<CommentBean>> createSocial(CommentBean commentBean) {
        if (CommentDB.insert(commentBean)) {
            return ResponseCreator.creatOk(commentBean, ResCode.CODE_OK, "评论成功");
        }

        return ResponseCreator.creatOk(commentBean, ResCode.ER_60000, "评论失败");
    }


}
